package com.ruoyi.lvlian.vo;

import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.lvlian.domain.DriverInfo;
import com.ruoyi.lvlian.domain.VehicleInfo;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.ToString;

import java.io.Serializable;
import java.util.List;

@Data
@ToString
public class DriverInfoVo extends DriverInfo  implements Serializable {
    private Long userId;
    private String nickName;
    private String phonenumber;

    private int vehicleCnt;
    @ApiModelProperty(value = "头像")
    private String avatar;


    private IdCardInfo idCardInfo;

    private List<VehicleInfo> vehicleInfoList;

/*    @ApiModelProperty(value = "身份证正面照片")
    private String idCardImg;

    @ApiModelProperty(value = "身份证背面照片")
    private String idCardBackImg;
    @ApiModelProperty(value = "身份证号")
    private String idCard;*/

/*    public IdCardInfo getIdCardInfo() {

        if (StringUtils.isEmpty(idCard)) {
            return null;
        }

        return idCardInfo;
    }*/

    public List<VehicleInfo> getVehicleInfoList() {
//        if (vehicleInfoList == null || vehicleInfoList.isEmpty()) {
//            return null;
//        }
//        if (StringUtils.isEmpty(vehicleInfoList.get(0).getId())) {
//            return null;
//        }
        return vehicleInfoList;
    }

    private boolean realName;

    public boolean isRealName() {
        if (idCardInfo == null) {
            return false;
        }
        if (StringUtils.isNotEmpty(idCardInfo.getIdCardImg())  ||  StringUtils.isNotEmpty(  getDriverLicenseImg() )) {
            return true;
        }
        return realName;
    }

    public void setIdCardInfo(IdCardInfo idCardInfo) {
        this.idCardInfo = idCardInfo;
    }
}
